import type { AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from "axios"

// 设置 interceptores 的别名
type FYInterceptorsType<T = InternalAxiosRequestConfig> = {
  requestSuccessFn?: (config: T) => T,
  requestFailureFn?: (err: any) => any,
  responseSuccessFn?: (res: AxiosResponse) => AxiosResponse,
  responseFailureFn?: (err: any) => any,
}

// 针对AxiosRequestConfig 配置进行扩展
export type newAxiosRequestConfig<T = any> = AxiosRequestConfig & {
  interceptors?: FYInterceptorsType<T>
}
